Repository navigation
Return the menu cursor to the entered row when going back - #12644
kmpeeduwee wants to merge 4 commits into
Conversation
Left and Backspace dropped the cursor to the top of the parent list. Each history frame now records the row that was drilled into, and going back lands on it. Without history the parent opens on the submenu's own row, and a search drilldown returns to the branch it was under.
Automated AI review
Verified: Going back now returns the cursor to the row that was entered, in every case the description names. No navigation regression was found in the tested scope. Cursor position after Left/Backspace, PR head compared with base:
Verified: Optional test improvement: The Moving the back decision into Pre-existing limitation (not introduced by this PR): Base shows the same shift for a cursor moved with the arrow keys. It needs a visibility change to land after Back, such as a guard evaluation still running on the first open or a real state change between opens. An unchanged cached guard result does not trigger it. Re-selecting by Review informationTest scope: Source review of the PR head and base, plus the Qt Declarative and Quickshell sources the menu relies on. AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Reviewed at 566b926 and reproduced on a worker built from the Omarchy ISO, with nothing found that needs changing. Reproduction. I drove the real menu with keys on the worker in two ways: open it, move down to Style, enter it, press Left; and summon it straight into Style, then press Backspace. On quattro (8b4eae6), and on this branch with the fix reverted, both land the cursor on Apps at the top of the list. On this branch, both land on Style. Tests. I ran these on the worker, with this branch merged onto quattro:
Review. This was reviewed by Claude Opus 5.5 and by Codex Medium as a second opinion. Independence between them is not guaranteed. Neither found a defect. Codex agreed on these points:
There are no competing pull requests or open issues for this. #13642 also touches This is waiting on the maintainer. |
Brings the fix onto current quattro. The only conflict was test/shell.d/menu-test.sh, where quattro dropped every assertion that reads QML source (omacom#16334); this keeps the nearestRowIndex unit tests and leaves out the source-regex assertions that went with them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch had stopped merging cleanly into The merge. The only conflict was in Reproduction. I ran it on a worker built from the Omarchy ISO and drove the real menu with keys. Style is now the top-level Appearance menu, so these steps use that. I tried two paths. In the first, I opened the menu, moved down to Appearance, pressed Right, then pressed Left. In the second, I summoned the menu straight into Appearance and pressed Backspace. On Tests, all on the worker:
Review. This was reviewed by Claude Opus 5.5, with Codex Medium and muse-wonder High as second opinions. Their independence is not guaranteed. Both found the merge, the test resolution and the change itself correct and proportionate. Both also raised the same edge case. The cursor is put back once, by position. If a menu guard's answer changes, its result can arrive just after you go back and add or remove a row above the one you returned to. The cursor then keeps its position and ends up one row off. It can only happen in that short window, and it is not new: The This fixes #13896. Of the open pull requests for that issue, this is the one triage recommended on the issue. It is now waiting on the maintainer. |
[Medium impact] The PR appears safe to merge; the remaining feedback concerns test coverage. Findings
SummaryThe menu now remembers which row opened each submenu and returns the cursor there when going back.
Runtime checks were not run because Quickshell is unavailable. Reviews (2) · Last reviewed commit: "Test that going back in the real menu la..." · Reviewed by Greptile |
| assertEqual(menu.nearestRowIndex(backItems, rootRows, 'learn'), 1, 'menu back lands on the row that was entered') | ||
| assertEqual(menu.nearestRowIndex(backItems, rootRows, 'style.bar.position'), 0, 'menu back from a search drilldown lands on the branch it was under') | ||
| assertEqual(menu.nearestRowIndex(backItems, rootRows, 'missing'), -1, 'menu back leaves the cursor alone for a row it cannot find') | ||
| assertEqual(menu.nearestRowIndex(backItems, [], 'style'), -1, 'menu back copes with an empty list') |
There was a problem hiding this comment.
Back navigation stays untested
These tests call only nearestRowIndex; they never enter a submenu or call goBack. Removing the new placeCursorOn call would bring back the original bug while every added assertion still passed. Add a behavior test that enters a non-first row, goes back, and checks the selected row. Include a link whose row differs from its target to check the saved history frame too.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Only MenuModel.js conflicted: quattro added altVariant and altVariantIds where this branch added nearestRowIndex, so both are kept side by side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The nearestRowIndex tests pass even with the placeCursorOn call removed from goBack, so nothing caught the bug coming back. The fixture loads the real Menu.qml, goes back out of Appearance after entering it and after being summoned into it, and fails on quattro with the cursor on Apps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch had stopped merging cleanly into A test for the fix. The four Reproduction, on a worker built from the Omarchy ISO, driving the real menu with keys: open it, move down to Appearance, press Right, then Left; and Tests, all on the worker:
Review. This was reviewed by Claude Opus 5.5, with Codex Medium and muse-wonder High as second opinions. Their independence is not guaranteed. Both found nothing to change. They checked the merge resolution, and that this branch still works with the click-into-submenu selection #18565 added to This fixes #13896, and of the open pull requests for that issue it is still the one triage recommended there. It is now waiting on the maintainer. |




Pressing Left or Backspace in the menu jumped the cursor to the top of the parent list instead of the row you had just drilled into.
Each history frame now records the entered row, so going back lands on it. If the menu was summoned straight into a submenu, the parent opens on that submenu's row. Coming back from a search drilldown lands on the branch it was under.
Tests:
test/shell.d/menu-test.shcovers the row lookup and thegoBackwiring.Fixes #13896